﻿using System;

namespace Community.CsharpSqlite.WP.SqliteDataProvider.Base
{
    /// <summary>
    /// Data column
    /// </summary>
    public class DataColumn 
    {
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        public Type Type { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DataColumn"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="column">The column.</param>
        public DataColumn(string name, object column)
        {
            Name = name;
            Type = column.GetType();
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return string.Format("Field={0} Type={1}", Name, Type);
        }
    }
}
